Skip to content

Add shortcut display to the menu - #42

Open
Manoj Singh (manojsingh) wants to merge 3 commits into
microsoft:mainfrom
manojsingh:add-shortcut-display
Open

Add shortcut display to the menu#42
Manoj Singh (manojsingh) wants to merge 3 commits into
microsoft:mainfrom
manojsingh:add-shortcut-display

Conversation

@manojsingh

Copy link
Copy Markdown

Added a menu item to quickly display all the shortcuts supported by this app. I had to revert to the repo readme.md file every time I wanted to try something out, so this may be helpful.

Copilot AI lite review requested due to automatic review settings August 3, 2026 16:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new status-bar menu entry to surface a “Keyboard Shortcuts” dialog, so developers/users can view current shortcut bindings without referencing the README. It also strengthens self-tests around status-menu correctness and wiring.

Changes:

  • Add “Keyboard Shortcuts” to the status menu and wire it to a new AppController.showShortcuts action.
  • Implement a shortcuts summary dialog that reads current global hotkeys from the settings store and presents in-mode key hints.
  • Extend self-tests to validate the new menu ordering and ensure all menu actions are wired to AppController.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Sources/ZoomItMacCore/SelfTest/SelfTestRunner.swift Adds a regression test to ensure status-menu actions are wired and updates expected menu order to include “Keyboard Shortcuts”.
Sources/ZoomItMacCore/App/AppDelegate.swift Inserts the new “Keyboard Shortcuts” entry into the status-menu entry list.
Sources/ZoomItMacCore/App/AppController.swift Adds the menu action and implements the shortcuts dialog UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/ZoomItMacCore/App/AppController.swift Outdated
@manojsingh

Copy link
Copy Markdown
Author

Manoj Singh (@manojsingh) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Fixed a potential issue which can trigger ambiguous-layout warnings and may cause the accessory text to size/position incorrectly

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 4, 2026 03:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (3)

Sources/ZoomItMacCore/App/AppController.swift:104

  • DemoType uses 0 as a disabled sentinel (SettingsWindowController.demoTypeHotKeyDisplayString() returns “None” when the code is 0). This dialog should match that behavior for both the Start and Reset variants.
        let demo = describe(code: settings.demoTypeHotKeyCode, modifiers: settings.demoTypeHotKeyModifiers)
        let demoReset = describe(
            code: settings.demoTypeHotKeyCode,
            modifiers: settings.demoTypeHotKeyModifiers ^ NSEvent.ModifierFlags.shift.rawValue
        )

Sources/ZoomItMacCore/App/AppController.swift:84

  • describe(code:modifiers:) treats keyCode 0 as “None”, but elsewhere in the codebase keyCode 0 is a valid key (“A”) for most hotkeys (see SettingsWindowController.keyNames[0]). Only some hotkeys (e.g. Snip OCR / DemoType) use 0 as a disabled sentinel. As written, this dialog will incorrectly display “None” if the user binds any non-optional hotkey to the A key.
        func describe(code: Int, modifiers: UInt) -> String {
            guard code != 0 else { return "None" }
            return SettingsWindowController.describe(
                keyCode: code,
                modifiers: NSEvent.ModifierFlags(rawValue: modifiers)

Sources/ZoomItMacCore/App/AppController.swift:94

  • Snip OCR uses 0 as a disabled sentinel (SettingsWindowController.snipOcrHotKeyDisplayString() returns “None” when the code is 0). After fixing describe(...) to treat 0 as a real key code, this line should preserve the “None” behavior for the disabled Snip OCR shortcut.

This issue also appears on line 100 of the same file.

        let snipOcr = describe(code: settings.snipOcrHotKeyCode, modifiers: settings.snipOcrHotKeyModifiers)

@manojsingh

Copy link
Copy Markdown
Author

Adding screenshots of the changes
menu
Shortcuts

@manojsingh
Manoj Singh (manojsingh) marked this pull request as ready for review August 4, 2026 03:44
@landsman

Copy link
Copy Markdown

good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants